package com.zhou.dynamic.controller;

import com.zhou.dynamic.pojo.UserInfo;
import com.zhou.dynamic.service.UserInfoService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by mrzho on 2018/1/24.
 */
@RestController
public class HelloController {
    private Logger logger = LoggerFactory.getLogger(getClass());
    @Autowired
    private UserInfoService userInfoService;
    @GetMapping("save")
    public String save() throws Exception {
        userInfoService.save();
        return null;
    }

    @GetMapping("query")
    public String query(){
        UserInfo user = userInfoService.selectByOddUserId(1);
        System.out.print(user.toString());
        logger.info(user.toString());
        return null;
    }
}
